package com.lk.service.impl;

import com.lk.service.MyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author : lk
 * @date 2021/11/18 14:23
 * @description : TODO
 * @since 1.0
 **/
@Service
@Slf4j
public class MyServiceImpl implements MyService {
    public static AtomicInteger count = new AtomicInteger(0);

    @Override
    public String retryService(String sql) {
        count.incrementAndGet();
        System.out.println(count.get());
        int i = 1 / 0;
        return "失败";
    }

    @Override
    public String retryHui(RuntimeException e, String sql) {
        log.error("e:{},sql:{}", e.getMessage(), sql);
        return "失败2";
    }
}
